<!DOCTYPE html>
<html lang="en" xmlns:th="http://thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>All Accounts</title>
    <link rel="stylesheet" href="../css/test.css"/>
</head>
<!--<body>-->
<div th:replace="common/top"></div>

<section class="content">
    <main>
        <div class="container">
            <div align="right"><a href="/account/viewMain" class="btn-close">return to main menu</a></div>
                <table class="table table-bordered table-striped table-hover">
                    <tr>
                        <th>Account Name</th>
                        <th>Password</th>
                        <th>Operations</th>
                    </tr>

                    <tr th:each="account:${accountList}">
                        <td>
                            <a th:href="@{/account/viewAccountMessage(accountId=${account.username})}"
                               th:text="${account.username}"></a>
                        </td>
                        <td th:text="${account.password}"></td>
                        <td>
                            <a th:href="@{/account/deleteAccount(accountId=${account.username})}">Delete</a>
                            <a th:href="@{/account/resetPassword(accountId=${account.username})}">Reset
                                Password</a>
                        <a th:href="@{/account/toEditAccount(accountId=${account.username})}"
                          >Edit</a></td>
                    </tr>
                </table>
            <a href="/account/toAddAccount" class="btn-close">Add Test Account</a>
        </div>
    </main>
</section>

<div th:replace="common/bottom"></div>
</body>
</html>